#ifndef _RCC_H_
#define _RCC_H_

#include "stm32f105xc.h"

struct rcc_reg {
    volatile unsigned int CR;
    volatile unsigned int CFGR;
    volatile unsigned int CIR;
    volatile unsigned int APB2RSTR;
    volatile unsigned int APB1RSTR;
    volatile unsigned int AHBENR;
    volatile unsigned int APB2ENR;
    volatile unsigned int APB1ENR;
    volatile unsigned int BDCR;
    volatile unsigned int CSR;
};

#define APB2_CLK (72)
#define APB1_CLK (36)
#define AHB_CLK  (72)

void init_rcc(void);

extern RCC_TypeDef *rcc_reg;

#endif
